package me.ereach.streams;

import java.util.List;

public class Main03Mapping {
    public static void main(String[] args) {
        List<Movie> movies = List.of(
                new Movie("a", 10),
                new Movie("b", 15),
                new Movie("c", 20)
        );

        // map method
        movies.stream()
                .map(movie -> movie.getTitle())
                .forEach(name -> System.out.println(name));

        System.out.println("===");
        // mapToInt
        movies.stream()
                .mapToInt(movie -> movie.getLikes())
                .forEach(val -> System.out.println(val));
    }
}
